import { http } from "@/utils/http"
import type { BannerItem, CategoryItem, HotItem, GuessItem } from '@/types/home'
import type { PageResult, PageParams } from "@/types/global"
// const getHomeBannerAPI = (distributionSite = 1) => {
//  return http({
//     method: 'GET',
//     url: '/home/banner',
//     data: {
//       distributionSite: distributionSite
//     }
//   })
// }
// 广告区域展示位置
// 1 为首页（默认值）
// 2 为商品分类页
export const getHomeBannerAPI = (distributionSite = 1) => http<BannerItem[]>({ method: 'GET', url: '/home/banner', data: { distributionSite: distributionSite } })


//前台分类数据
// /home/category/mutli get
export const getCategoryAPI = () => {
  return http<CategoryItem[]>({
    url: '/home/category/mutli',
    method: 'GET'
  })
}


// 首页-热门推荐-小程序
// GET
// /home/hot/mutli

export const getHotPanelAPI = () => {
  return http<HotItem[]>({
    url: '/home/hot/mutli',
    method: 'GET'
  })
}

// 猜你喜欢-小程序
// GET
// /home/goods/guessLike  page pageSize

export const getLikeAPI = (data?: PageParams) => {
  return http<PageResult<GuessItem>>({
    method: 'GET',
    url: '/home/goods/guessLike',
    data
  })
}




